package mtgGameObjects.mtgGameTypes.mtgGameCardTypes.mtgGameContextTypes;

import java.util.List;

import mtgGameObjects.mtgGameTypes.mtgGameTypeMana.mtgGameTypeManaCost.MtgGameTypeManaCost;

public class MtgGameCardContextTypeSpell {
	
	private List<MtgGameTypeManaCost> manaCost;
	
	public void addManaCost(MtgGameTypeManaCost manaCost){
		boolean hasBeenAdded = false;
		for (MtgGameTypeManaCost mCost:this.getManaCost()){
			//TODO voir si ça marche
			if (mCost.getClass()==manaCost.getClass()){
				mCost.addQuantity(manaCost.getQuantity());
				hasBeenAdded = true;
			}
		}
		if (!hasBeenAdded){
			this.manaCost.add(manaCost);
		}
	}
	
	public void setManaCost(List<MtgGameTypeManaCost> manaCost){
		for (MtgGameTypeManaCost mCost:manaCost){
			this.addManaCost(mCost);
		}
	}
	
	public List<MtgGameTypeManaCost> getManaCost(){
		return this.manaCost;
	}
	
	
}
